var isPalindrome = function(head) {
    // 先把前半截反转，然后前半截遍历，后半截遍历
    let prev
    let fast = slow = head 
    while( fast && fast.next){
        fast = fast.next.next

        let next = slow.next //先把他的next存起来
        slow.next = prev          //把他的next修改
        prev = slow     //保留当前节点
        slow = next          //往后走
    }
    //当有奇数个时这个时候fast在最后一个节点上
    //如果为偶数的话fast为null
    if(fast){
        slow = slow.next
    }
    while(prev && slow){
        if(prev.val !== slow.val){
            return false 
        }
        prev = prev.next
        slow = slow.next
    }
    return true

};